/*
 * @Author: your name
 * @Date: 2021-04-18 19:52:42
 * @LastEditTime: 2021-04-18 20:05:33
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \新建文件夹\the-third-group\patient-app\src\utils\debounce.js
 */
const debounce = (fnc, time) => {
    let timer = null
    return (e) => {
        console.log(1)
        timer&&clearTimeout(timer)
        console.log(2)
        timer = setTimeout(() => {
            timer = null
            fnc.call(this, e)
            console.log(3)
        }, time)
    }
}

export default debounce